%%%-------------------------------------------------------------------
%%% @doc  
%%% @end
%%%-------------------------------------------------------------------
-module(dp_sup).

-behaviour(supervisor).
%%--------------------------------------------------------------------
%% Include files
%%--------------------------------------------------------------------

%%--------------------------------------------------------------------
%% External exports
%%--------------------------------------------------------------------
-export([
	 start_link/1
        ]).

%%--------------------------------------------------------------------
%% Internal exports
%%--------------------------------------------------------------------
-export([
	 init/1
        ]).

%%--------------------------------------------------------------------
%% Macros
%%--------------------------------------------------------------------
-define(SERVER, ?MODULE).

%%--------------------------------------------------------------------
%% Records
%%--------------------------------------------------------------------

%%====================================================================
%% External functions
%%====================================================================
%%--------------------------------------------------------------------
%% @doc Starts the supervisor.
%% @spec start_link(StartArgs) -> {ok, pid()} | Error
%% @end
%%--------------------------------------------------------------------
start_link(StartArgs) ->
    supervisor:start_link({local, ?SERVER}, ?MODULE, []).

%%====================================================================
%% Server functions
%%====================================================================
%%--------------------------------------------------------------------
%% Func: init/1
%% Returns: {ok,  {SupFlags,  [ChildSpec]}} |
%%          ignore                          |
%%          {error, Reason}   
%%--------------------------------------------------------------------
init([]) ->
  RestartStrategy    = one_for_one,
  MaxRestarts        = 1000,
  MaxTimeBetRestarts = 3600,
  
  SupFlags = {RestartStrategy, MaxRestarts, MaxTimeBetRestarts},
  
  ChildSpecs =
  	[
   	 {config_server,
   	  {config_server, start_link, []},
   	  permanent,
   	  1000,
   	  worker,
   	  [config_server]},
  	 {dp_server,
  	  {dp_server, start_link, []},
  	  permanent,
  	  1000,
  	  worker,
  	  [dp_server]},
  	 {rq_server,
  	  {rq_server, start_link, []},
  	  permanent,
  	  1000,
  	  worker,
  	  [rq_server]}
  	 ],
  {ok,{SupFlags, ChildSpecs}}.
%%====================================================================
%% Internal functions
%%====================================================================
